﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Windows;

namespace Bixas.Tangibilis.Controls.Primitives
{
    public delegate void TouchScaleStartedEventHandler(object sender, TouchScaleStartedEventArgs e);

    public class TouchScaleStartedEventArgs : RoutedEventArgs
    {
        // Fields
        
        // Methods
        public TouchScaleStartedEventArgs()
        {
            base.RoutedEvent = TouchThumb.TouchScaleStartedEvent;
        }

        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
        {
            TouchScaleStartedEventHandler handler = (TouchScaleStartedEventHandler)genericHandler;
            handler(genericTarget, this);
        }
    }

    public delegate void TouchScaleDeltaEventHandler(object sender, TouchScaleDeltaEventArgs e);

    public class TouchScaleDeltaEventArgs : RoutedEventArgs
    {
        // Fields
        private double _scaleFactor;
        
        // Methods
        public TouchScaleDeltaEventArgs(double scaleFactor)
        {
            this._scaleFactor = scaleFactor;
            base.RoutedEvent = TouchThumb.TouchScaleDeltaEvent;
        }

        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
        {
            TouchScaleDeltaEventHandler handler = (TouchScaleDeltaEventHandler)genericHandler;
            handler(genericTarget, this);
        }

        // Properties
        public double ScaleFactor
        {
            get
            {
                return this._scaleFactor;
            }
        }

    }

    public delegate void TouchScaleCompletedEventHandler(object sender, TouchScaleCompletedEventArgs e);

    public class TouchScaleCompletedEventArgs : RoutedEventArgs
    {
        // Fields
        private double _scaleFactor;
        private bool _wasCanceled;

        // Methods
        public TouchScaleCompletedEventArgs(double scaleFactor, bool canceled)
        {
            this._scaleFactor = scaleFactor;
            this._wasCanceled = canceled;
            base.RoutedEvent = TouchThumb.TouchScaleCompletedEvent;
        }

        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
        {
            TouchScaleCompletedEventHandler handler = (TouchScaleCompletedEventHandler)genericHandler;
            handler(genericTarget, this);
        }

        // Properties
        public bool Canceled
        {
            get
            {
                return this._wasCanceled;
            }
        }

        public double ScaleFactor
        {
            get
            {
                return this._scaleFactor;
            }
        }
    }








}
